box: Only emit pack-type notify if the pack type really changed
authorBenjamin Otte <otte@redhat.com>
Fri, 27 May 2011 16:52:02 +0000 (18:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 2 Jun 2011 00:03:51 +0000 (02:03 +0200)
This is not very useful in itself, but the code reorg will be useful
once we do style invalidation.

gtk/gtkbox.c

index 9a205792cda24a43c19df837983a7a15f333b7f2..b1d1df952bc0799673df2e22c6bd6e5eec824b48 100644 (file)
@@ -1612,11 +1612,13 @@ gtk_box_set_child_packing (GtkBox      *box,
       gtk_widget_child_notify (child, "fill");
       child_info->padding = padding;
       gtk_widget_child_notify (child, "padding");
-      if (pack_type == GTK_PACK_END)
-       child_info->pack = GTK_PACK_END;
-      else
-       child_info->pack = GTK_PACK_START;
-      gtk_widget_child_notify (child, "pack-type");
+      if (pack_type != GTK_PACK_END)
+        pack_type = GTK_PACK_START;
+      if (child_info->pack_type != pack_type)
+        {
+         child_info->pack = GTK_PACK_END;
+          gtk_widget_child_notify (child, "pack-type");
+        }
 
       if (gtk_widget_get_visible (child)
           && gtk_widget_get_visible (GTK_WIDGET (box)))